<?php
include ('../model/connect.php');
include ('../model/Student/class-student.php');
session_start();

$studentid = $_POST['studentname'];
$studentpass = $_POST['studentpass'];
$student = new Student();
echo($student->checkLogin($studentid,$studentpass));

if($student->checkLogin($studentid,$studentpass)){
    $_SESSION["username"] = $studentid;
	$_SESSION["user"] = $student;
    header("location:http:/educational/student-index.php");
}else{
    $_SESSION["error"] = "<script>alert(\"Login error !!!\");</script>";
    header("location:http:/educational/index.php");
}

mysql_close($conn);

?>